<?php

/**
 * Usuario filter form base class.
 *
 * @package    cronos-doctrine
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseUsuarioFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'user_id'         => new sfWidgetFormFilterInput(),
      'empresa_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => true)),
      'agente_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UserAgente'), 'add_empty' => true)),
      'titulo_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Titulo'), 'add_empty' => true)),
      'parroquia_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Parroquia'), 'add_empty' => true)),
      'referido_id'     => new sfWidgetFormFilterInput(),
      'usuario_cod'     => new sfWidgetFormFilterInput(),
      'nombre'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apellido'        => new sfWidgetFormFilterInput(),
      'punto_lealtad'   => new sfWidgetFormFilterInput(),
      'foto'            => new sfWidgetFormFilterInput(),
      'status'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('LlamadaStatus'), 'add_empty' => true)),
      'nota_fija'       => new sfWidgetFormFilterInput(),
      'depuracion'      => new sfWidgetFormFilterInput(),
      'depuracion_nota' => new sfWidgetFormFilterInput(),
      'llamadas_nr'     => new sfWidgetFormFilterInput(),
      'num_masc'        => new sfWidgetFormFilterInput(),
      'created_at'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'user_id'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'empresa_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Empresa'), 'column' => 'id')),
      'agente_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('UserAgente'), 'column' => 'id')),
      'titulo_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Titulo'), 'column' => 'id')),
      'parroquia_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Parroquia'), 'column' => 'id')),
      'referido_id'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'usuario_cod'     => new sfValidatorPass(array('required' => false)),
      'nombre'          => new sfValidatorPass(array('required' => false)),
      'apellido'        => new sfValidatorPass(array('required' => false)),
      'punto_lealtad'   => new sfValidatorPass(array('required' => false)),
      'foto'            => new sfValidatorPass(array('required' => false)),
      'status'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('LlamadaStatus'), 'column' => 'id')),
      'nota_fija'       => new sfValidatorPass(array('required' => false)),
      'depuracion'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'depuracion_nota' => new sfValidatorPass(array('required' => false)),
      'llamadas_nr'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'num_masc'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('usuario_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Usuario';
  }

  public function getFields()
  {
    return array(
      'id'              => 'Number',
      'user_id'         => 'Number',
      'empresa_id'      => 'ForeignKey',
      'agente_id'       => 'ForeignKey',
      'titulo_id'       => 'ForeignKey',
      'parroquia_id'    => 'ForeignKey',
      'referido_id'     => 'Number',
      'usuario_cod'     => 'Text',
      'nombre'          => 'Text',
      'apellido'        => 'Text',
      'punto_lealtad'   => 'Text',
      'foto'            => 'Text',
      'status'          => 'ForeignKey',
      'nota_fija'       => 'Text',
      'depuracion'      => 'Number',
      'depuracion_nota' => 'Text',
      'llamadas_nr'     => 'Number',
      'num_masc'        => 'Number',
      'created_at'      => 'Date',
      'updated_at'      => 'Date',
    );
  }
}
